package com.sgcc.ln.pmos.common.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import com.sgcc.pmos.nativesdk.R;
import com.sgcc.ln.pmos.common.base.ChartMakerBean;
import com.sgcc.ln.pmos.common.utils.GradientDrawableUtil;

import java.util.List;


public class ChartMakerAdapter extends BaseQuickAdapter<ChartMakerBean, BaseViewHolder> {

    public ChartMakerAdapter(List<ChartMakerBean> list) {
        super(R.layout.item_chart_maker, list);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, ChartMakerBean s) {

        if (s.getKey().equals("1")) {
            GradientDrawableUtil.rect(baseViewHolder.getView(R.id.view), s.getColor());
        } else
            GradientDrawableUtil.filletOval(baseViewHolder.getView(R.id.view), s.getColor(), 4);


        baseViewHolder.setText(R.id.tvText, s.getValue());


    }
}
